<?php

require_once dirname(__FILE__) . '/../libs/core/ApplicationCore.php';

class ConfigLoader {

    var $databaseCfg;
    var $errorsCfg;
    var $webCfg;

    public function __construct() {
        $applicationCore = $this->getAppCore();
        
        $this->errorsCfg = $applicationCore->ParseGenericINIfile(ApplicationCore::ErrorsINIfile());
        $this->webCfg = $applicationCore->ParseGenericINIfile(ApplicationCore::WebINIfile());

        $this->LoadPage();
    }

    public function getAppCore(){
        return new ApplicationCore();
    }

    public function ErrorsConnection() {
        return $this->getAppCore()->ERRORConnect($this->errorsCfg);
    }

    public function WebConnection() {
        return $this->getAppCore()->WEBConnect($this->webCfg);
    }

    private function LoadPage() {
        $this->ErrorsConnection();
        $this->WebConnection();
    }

}

?>